home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / MoreFiles 1.1.1 / FSpCompat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-22  |  5.7 KB  |  194 lines  |  [TEXT/KAHL]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    FSSpec compatibility functions.
  5. **
  6. **    by Jim Luther, Apple Developer Technical Support
  7. **
  8. **    File:        FSpCompat.h
  9. **
  10. **    Copyright © 1992-1994 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __FSPCOMPAT__
  23. #define __FSPCOMPAT__
  24.  
  25. #ifndef __CONDITIONALMACROS__
  26. #include <ConditionalMacros.h>
  27. #endif
  28.  
  29. #ifndef __TYPES__
  30. #include <Types.h>
  31. #endif
  32.  
  33. #ifndef __LOWMEM__
  34. #include <LowMem.h>
  35. #endif
  36.  
  37. #ifndef __GESTALTEQU__
  38. #include <GestaltEqu.h>
  39. #endif
  40.  
  41. #ifndef __RESOURCES__
  42. #include <Resources.h>
  43. #endif
  44.  
  45. #ifndef __SCRIPT__
  46. #include <Script.h>
  47. #endif
  48.  
  49. /* The old interfaces needed this for the gestaltQuickTime selector */
  50. //#ifndef __MOVIES__
  51. //#include <Movies.h>
  52. //#endif
  53.  
  54. #ifndef __MOREFILESEXTRAS__
  55. #include "MoreFilesExtras.h"
  56. #endif
  57.  
  58. /*****************************************************************************/
  59.  
  60. pascal    OSErr    FSMakeFSSpecCompat(short vRefNum,
  61.                                    long dirID,
  62.                                    ConstStr255Param fileName,
  63.                                    FSSpecPtr spec);
  64. /*    Differences from FSMakeFSSpec:
  65.     If the file system can't create the FSSpec, then the compatibility code
  66.     creates a FSSpec that is exactly like an FSSpec except that spec.name
  67.     for a file may not have the same capitalization as the file's catalog
  68.     entry on the disk volume. That is because fileName is parsed to get the
  69.     name instead of getting the name back from the file system. This works
  70.     fine with System 6 where FSMakeSpec isn't available.
  71. */
  72.  
  73. /*****************************************************************************/
  74.  
  75. pascal    OSErr    FSpOpenDFCompat(const FSSpec *spec,
  76.                                 char permission,
  77.                                 short *refNum);
  78. /*    Differences from FSpOpenDF:
  79.     If FSpOpenDF isn't available, FSpOpenDFCompat uses PHBOpen because
  80.     System 6 doesn't support PBHOpenDF. This means FSpOpenDFCompat could
  81.     accidentally open a driver if the spec->name begins with a period.
  82. */
  83.  
  84. /*****************************************************************************/
  85.  
  86. pascal    OSErr    FSpOpenRFCompat(const FSSpec *spec,
  87.                                 char permission,
  88.                                 short *refNum);
  89. /*    No known differences from FSpOpenRF.
  90. */
  91.  
  92.  
  93. /*****************************************************************************/
  94.  
  95. pascal    OSErr    FSpCreateCompat(const FSSpec *spec,
  96.                                 OSType creator,
  97.                                 OSType fileType,
  98.                                 ScriptCode scriptTag);
  99. /*    Differences from FSpCreate:
  100.     FSpCreateCompat correctly sets the fdScript in the file's FXInfo record
  101.     to scriptTag.
  102. */
  103.  
  104. /*****************************************************************************/
  105.  
  106. pascal    OSErr    FSpDirCreateCompat(const FSSpec *spec,
  107.                                    ScriptCode scriptTag,
  108.                                    long *createdDirID);
  109. /*    No known differences from FSpDirCreate.
  110. */
  111.  
  112. /*****************************************************************************/
  113.  
  114. pascal    OSErr    FSpDeleteCompat(const FSSpec *spec);
  115. /*    No known differences from FSpDelete.
  116. */
  117.  
  118. /*****************************************************************************/
  119.  
  120. pascal    OSErr    FSpGetFInfoCompat(const FSSpec *spec,
  121.                                   FInfo *fndrInfo);
  122. /*    No known differences from FSpGetFInfo.
  123. */
  124.  
  125. /*****************************************************************************/
  126.  
  127. pascal    OSErr    FSpSetFInfoCompat(const FSSpec *spec,
  128.                                   const FInfo *fndrInfo);
  129. /*    No known differences from FSpSetFInfo.
  130. */
  131.  
  132. /*****************************************************************************/
  133.  
  134. pascal    OSErr    FSpSetFLockCompat(const FSSpec *spec);
  135. /*    No known differences from FSpSetFLock.
  136. */
  137.  
  138. /*****************************************************************************/
  139.  
  140. pascal    OSErr    FSpRstFLockCompat(const FSSpec *spec);
  141. /*    No known differences from FSpRstFLock.
  142. */
  143.  
  144. /*****************************************************************************/
  145.  
  146. pascal    OSErr    FSpRenameCompat(const FSSpec *spec,
  147.                                 ConstStr255Param newName);
  148. /*    No known differences from FSpRename.
  149. */
  150.  
  151. /*****************************************************************************/
  152.  
  153. pascal    OSErr    FSpCatMoveCompat(const FSSpec *source,
  154.                                  const FSSpec *dest);
  155. /*    No known differences from FSpCatMove.
  156. */
  157.  
  158. /*****************************************************************************/
  159.  
  160. pascal    OSErr    FSpExchangeFilesCompat(const FSSpec *source,
  161.                                        const FSSpec *dest);
  162. /*    Differences from FSpExchangeFiles:
  163.     Correctly exchanges files on volumes that don't support PBExchangeFiles.
  164.     FSpExchangeFiles attempts to support volumes that don't support
  165.     PBExchangeFiles, but in System 7, 7.0.1, 7.1, and 7 Pro, the
  166.     compatibility code just doesn't work on volumes that don't support
  167.     PBExchangeFiles (even though you may get a noErr result).
  168.     Future versions of system softare will have the problems in
  169.     FSpExchangeFiles corrected.
  170. */
  171.  
  172. /*****************************************************************************/
  173.  
  174. pascal    short    FSpOpenResFileCompat(const FSSpec *spec,
  175.                                      SignedByte permission);
  176. /*    No known differences from FSpOpenResFile.
  177. */
  178.  
  179. /*****************************************************************************/
  180.  
  181. pascal    void    FSpCreateResFileCompat(const FSSpec *spec,
  182.                                        OSType creator,
  183.                                        OSType fileType,
  184.                                        ScriptCode scriptTag);
  185. /*    Differences from FSpCreateResFile:
  186.     FSpCreateResFileCompat correctly sets the fdScript in the file's
  187.     FXInfo record to scriptTag.
  188. */
  189.  
  190. /*****************************************************************************/
  191.  
  192. #endif
  193.  
  194.